import request from '@/utils/request'

// 查询用车申请列表
export function listApplycar(query) {
	return request({
		url: '/bpmapply/applycar/list',
		method: 'get',
		params: query
	})
}

/**
 * 通过行程ID查询用车申请详细
 * @param {Object} id
 */
export function getInfoApply(id) {
	return request({
		url: '/bpmapply/applycar/getInfoApply/' + id,
		method: 'get'
	})
}

// 查询用车申请详细
export function getApplycar(id) {
	return request({
		url: '/bpmapply/applycar/' + id,
		method: 'get'
	})
}

// 新增用车申请
export function addApplycar(data) {
	return request({
		url: '/bpmapply/applycar',
		method: 'post',
		data: data
	})
}

// 修改用车申请
export function updateApplycar(data) {
	return request({
		url: '/bpmapply/applycar',
		method: 'put',
		data: data
	})
}

// 删除用车申请
export function delApplycar(id) {
	return request({
		url: '/bpmapply/applycar/' + id,
		method: 'delete'
	})
}

// 查询司机下拉树结构
export function driverTreeSelect() {
	return request({
		url: '/usecar/details/driverTree',
		method: 'get'
	})
}

// 查询车型下拉树结构
export function carTreeSelect() {
	return request({
		url: '/usecar/details/carTree',
		method: 'get'
	})
}

/**
 * 查询司机
 * @param {Object} month
 */
export function getDriverList(data) {
	return request({
		url: `/app/driver/list`,
		method: 'post',
		data: data
	})
}

/**
 * 查询车型
 * @param {Object} month
 */
export function getCarList(data) {
	return request({
		url: `/app/car/list`,
		method: 'post',
		data: data
	})
}